
package teehee.UI;

import teehee.homepage.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

/**
 * @author Bohan Liu
 *
 */
public class Health extends Activity{

	public void onCreate(Bundle savedInstanceState) {

	    
        super.onCreate(savedInstanceState);
        setContentView(R.layout.health);

       
        Button goWeight = (Button) findViewById(R.id.WeightButton); 
        goWeight.setOnClickListener(new OnClickListener()  
        {
        	public void onClick(View v) 
        	{

        		Intent weightp = new Intent(Health.this, SubmitInfo.class);
        		startActivity(weightp);
                
        	}
        });
        
        
        
        Button goHistory = (Button) findViewById(R.id.HhistoryButton); 
        goHistory.setOnClickListener(new OnClickListener()  
        {
        	public void onClick(View v) 
        	{


        		Intent HealthHistoryp = new Intent(Health.this, HealthHistory.class);
        		startActivity(HealthHistoryp);
                
        	}
        });
        
        
        Button goBmi = (Button) findViewById(R.id.BmiButton); 
        goBmi.setOnClickListener(new OnClickListener()  
        {
        	public void onClick(View v) 
        	{


        		Intent Bmip = new Intent(Health.this, Bmi.class);
        		startActivity(Bmip);
                
        	}
        });


        

    }
	
	 @Override 
	    public boolean onKeyDown(int keyCode, KeyEvent event) 
	    {
	        if ((keyCode == KeyEvent.KEYCODE_MENU))
	        { 
	        	//setContentView(R.layout.main);
	        	Intent homep = new Intent(Health.this, MainPage.class);
	    		startActivity(homep);
	            return true;
	        }
	        
	        if ((keyCode == KeyEvent.KEYCODE_SEARCH))
	        { 
	        	//setContentView(R.layout.main);
	        	Intent homep = new Intent(Health.this, SearchPage.class);
	    		startActivity(homep);
	            return true;
	        }
	        
	        return super.onKeyDown(keyCode, event);    
	    } 

}